
    import com.inotai.jasmine.*;
	import com.inotai.jasmine.value.*;

	JasmineWriter writer = new JasmineWriter( new JasmineFormatter() );
	
	def test_value = { value, expected ->
		StringBuilder builder = new StringBuilder();
		writer.write(value, builder);
		assert( builder.toString() == expected );
	}
	
	// Null
	test_value( Value.createNullValue(), "null" );
	
	// Boolean
	test_value( Value.createBooleanValue(true), "true" );
	test_value( Value.createBooleanValue(false), "false" );
	
	// Integer
	test_value( Value.createIntegerValue(0), "0" );
	test_value( Value.createIntegerValue(1), "1" );
	test_value( Value.createIntegerValue(-123), "-123" );
	
	// Real
	test_value( Value.createRealValue(3.14), "3.14" );
	
	// Double quoted
	test_value( Value.createStringValue("abc"), "\"abc\"" );
	test_value( Value.createStringValue("\b\f\n\r\t\\\""), "\"\\b\\f\\n\\r\\t\\\\\\\"\"" );
	test_value( Value.createStringValue("\u0001"), "\"\\u0001\"" );
	
	// Single quoted
	test_value( Value.createStringValue("abc", StringType.SINGLE_QUOTED), "'abc'" );
	test_value( Value.createStringValue("\b\f\n\r\t\'", StringType.SINGLE_QUOTED), "'\b\f\n\r\t'''" );
	test_value( Value.createStringValue("\u0001", StringType.SINGLE_QUOTED), "'\\u0001'" );

	// Unquoted	
	test_value( Value.createStringValue("h e l l o w o r l d", StringType.UNQUOTED), "helloworld" );
	test_value( Value.createStringValue("hell-of-the.world_land", StringType.UNQUOTED), "hell-of-the.world_land" );
	test_value( Value.createStringValue("##hello\$%", StringType.UNQUOTED), "hello" );
	
	// RegEx
	test_value( Value.createRegExpValue("[0-9]/A-Z", "adp"), "/[0-9]\\/A-Z/adp" );

	// List
	ListValue listValue = Value.createListValue();
	listValue.add( Value.createIntegerValue(1) );
	listValue.add( Value.createIntegerValue(2) );
	listValue.add( Value.createIntegerValue(3) );
	test_value( listValue, "[1 2 3]" );
	
	// Dictionary
	DictionaryValue dictionaryValue = Value.createDictionaryValue();
	dictionaryValue.add( "one", Value.createIntegerValue(1) );
	dictionaryValue.add( "two", Value.createIntegerValue(2) );
	dictionaryValue.add( "three", Value.createIntegerValue(3) );
	test_value( dictionaryValue, "{one:1 two:2 three:3}" );